package com.yihaodian.index.meta.shard.impl;

import java.util.HashMap;
import java.util.Map;

public class ZkCategoryShardConfig extends ZkShardConfig {

	/**
	 *   Return relative data path (without /search/index/<index-name>/v1/shard/)    
	 *   
	 *   # routing table
	 *   /search/index
	 *   /search/index/<index-name>/v1/shard/routing/c1/c2/c3/c4/0    -> shard 1
	 *   /search/index/<index-name>/v1/shard/routing/c1/c2/c3/c5/0    -> shard 1
	 *   /search/index/<index-name>/v1/shard/routing/c1/c2/c3/0       -> shard 2
	 *   /search/index/<index-name>/v1/shard/routing/c1/0             -> shard 3
	 *   /search/index/<index-name>/v1/shard/routing/0                -> shard 0                                                                                                      
	 *
	 *
	 *   # sharding table
	 *   /search/index/<index-name>/v1/shard/shards/1                 -> c1.c2.c3.c4
	 *                                                                   c1.c2.c3.c5
	 *   /search/index/<index-name>/v1/shard/shards/2                 -> c1.c2.c3.0
	 *   /search/index/<index-name>/v1/shard/shards/3                 -> c1.0.0.0
     *   
	 */
	@Override
	protected Map<String, Byte[]> toZkData(ShardRule rule) {
		Map<String, Byte[]> map = new HashMap<String, Byte[]>();
		
		if(rule instanceof CategoryShardRule) {
			// TODO
		}
		return map;
	}

}
